/**
 * 
 */
package com.swe727.spring2011.constraint1.server;

import java.rmi.RemoteException;

import com.swe727.spring2011.constraint1.observation.Observation;
import com.swe727.spring2011.constraint1.observation.ObservationDataStore;



/**
 * The remote object instance for saving observations.
 * @author Trevor Wright
 *
 */
public class SaveObservationHandler implements SaveObservationRemote {

	private final ObservationDataStore STORE;
	
	/**
	 * Create a new handler which will save observations to the given store.
	 * @param dataStore store to which observations are saved.
	 */
	public SaveObservationHandler(ObservationDataStore dataStore) {
		STORE = dataStore;
	}
	
	/* (non-Javadoc)
	 * @see com.swe727.spring2011.constraint1.server.SaveObservation#saveObservation(com.swe727.spring2011.constraint1.observation.Observation)
	 */
	public void saveObservation(Observation obs) throws RemoteException {
		STORE.add(obs);
	}
}
